package com.rhb.oa.news.web.struts.form;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

import com.rhb.oa.news.bean.News;
import com.rhb.oa.news.bean.NewsQuery;
import com.rhb.web.struts.form.ListForm;

public class NewsForm extends ListForm {

	// Fields
	private News news;
	private NewsQuery newsQuery;
	
	// default construct
	public NewsForm() {
		news = new News();
		newsQuery = new NewsQuery();
	}
	
	// get, set
	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	public NewsQuery getNewsQuery() {
		return newsQuery;
	}

	public void setNewsQuery(NewsQuery newsQuery) {
		this.newsQuery = newsQuery;
	}

	// validate
	public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

		ActionErrors errors = new ActionErrors();

		if ("add".equalsIgnoreCase(this.getBehavior()) || "edit".equalsIgnoreCase(this.getBehavior())) {
																																																						}

		return errors;
	}
}
